package maze;

public class Global {
    /**
     * 迷宫的二维数组表示，1表示不能通过，0表示可以通过
     */
    public static int M[][] = {
            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
            {1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1},
            {1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1},
            {1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1},
            {1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1},
            {1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1},
            {1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1},
            {1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1},
            {1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 1},
            {1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1},
            {1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1},
            {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
    };

	/*public static int[][] M = {
		{1,1,1,1,1,1,1,1,1,1},
        {1,0,0,1,0,0,1,1,1,1},
        {1,1,0,1,0,0,0,1,1,1},
        {1,0,0,0,0,1,0,0,1,1},
        {1,0,0,1,1,0,1,0,1,1},
        {1,1,0,0,0,1,0,0,0,1},
        {1,0,1,1,0,0,0,1,0,1},
        {1,1,1,1,1,1,1,1,1,1}
    };*/

    public static void print(int M[][]) {
        for (int h = 0; h < M.length; h++) {
            for (int g = 0; g < M[0].length; g++) {
				/*if(M[h][g] == 1)
					System.out.print("■ ");
				if(M[h][g] == 0)
					System.out.print("0 ");
				if(M[h][g] == -1)
					System.out.print("□ ");*/
                if (M[h][g] == 1)
                    System.out.print("1 ");
                if (M[h][g] == 0)
                    System.out.print("0 ");
                if (M[h][g] == -1)
                    System.out.print("8 ");
            }
            System.out.println();
        }
        System.out.println();
    }
}

class StackPos {
    int i;
    int j;

    //next用来保存下一个方位的表示（0.1.2.3分别代表东北西南）；
    int next;

    public StackPos(int i, int j, int next) {
        this.i = i;
        this.j = j;
        this.next = next;
    }
}

class QueuePos {
    int i;
    int j;

    //保存是作为哪个位置的下一个可行位置加入队列的，以便最后输出完整的可行路径
    QueuePos front;

    public QueuePos(int i, int j, QueuePos front) {
        this.i = i;
        this.j = j;
        this.front = front;
    }
}
